package com.safety51.bootstrap.demo.domain.student.entity;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;

/**
 * Created by liuyuancheng on 2021/9/7  <br/>
 *
 * @author liuyuancheng
 */
@Data
@Entity
public class Teacher {

    @Id
    private Integer id;

    @NotBlank(message = "name不能为空")
    @Length(min = 3, max = 10, message = "name的长度在3-10之间")
    private String name;

    @Email(message = "邮箱格式不合法")
    private String email;

    private String dateOfBirth;
}
